package com.cro.prison.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cro.prison.dao.UserDao;
import com.cro.prison.entity.pojo.User;
import com.cro.prison.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserService {
    //植入dao层对象
    @Autowired
    private UserDao userDao;

    @Override
    public User login(String username, String password) {
        return userDao.login(username,password);
    }

    @Override
    public User selectById(Long userId) {
        return userDao.selectById(userId);
    }

    @Override
    public List<User> listAll() {
        return list();
    }
}
